package com.gitee.feizns.quickstart.ding.talk.domain;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 搜索条件
 * @author feizns
 * @since 2023/05/09
 */
@NoArgsConstructor
@Data
public class SearchCondition {

    /**
     * 关键
     */
    private String key;

    /**
     * value
     */
    private String value;

    /**
     * type
     */
    private String type;

    /**
     * operator
     */
    private String operator;

    /**
     * componentName
     */
    private String componentName;

    /**
     * 文本
     * @param key 关键
     * @param value 价值
     * @return {@link SearchCondition}
     */
    public static SearchCondition textEq(String key, String value) {
        SearchCondition condition = new SearchCondition();
        condition.key = key;
        condition.value = value;
        condition.type = "TEXT";
        condition.operator = "eq";
        condition.componentName = "TextField";
        return condition;
    }

}
